package com.app.timepicker;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.view.Gravity;
import android.view.View;
import android.widget.Toast;

import com.zndroid.timePicker.TimerPicker;
import com.zndroid.timePicker.impl.PickerDialog;
import com.zndroid.timePicker.impl.PickerType;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void showB(View view) {
        TimerPicker.show(this, new PickerDialog.OnDateResultListener() {
            @Override
            public void onDateResult(long timeMillis) {
                Log.i("hyhy", timeMillis + "");
            }

            @Override
            public void onDateResult(String formatDate) {
                Toast.makeText(MainActivity.this, formatDate, Toast.LENGTH_SHORT).show();

            }
        });
    }

    public void showC(View view) {
        TimerPicker.show(this, PickerType.YMD, Gravity.CENTER, true, 2000, 2019, new PickerDialog.OnDateResultListener() {
            @Override
            public void onDateResult(long timeMillis) {
                Log.i("hyhy", timeMillis + "");
            }

            @Override
            public void onDateResult(String formatDate) {
                Toast.makeText(MainActivity.this, formatDate, Toast.LENGTH_SHORT).show();
            }
        });
    }
}